#include <cstdio>
using namespace std;

int main()
{
    int num = 0;
    scanf(" %d", &num);
    for (int i = 0; i < num; i++) {
        int length, sum = 0, temp;
        scanf(" %d", &length);
        for (int j = 0; j < length; j++) {
            scanf(" %d", &temp);
            sum += temp;
        }
        printf("%d\n\n", sum);
    }

    return 0;
}